#include <iostream>
#include "XMLDocument.h"

using namespace std;

XMLDocument::XMLDocument()
{
	this->dtdDocument = NULL;
	this->rootNode = NULL;
}

XMLDocument::~XMLDocument()
{
	delete this->rootNode;
	delete this->dtdDocument;
}

void XMLDocument::addElement(XMLElement* element)
{
	this->childList.push_back(element);
}

void XMLDocument::setRootNode(XMLElement* element)
{
	this->rootNode = element;
}

void XMLDocument::setDtdDocument(DTDDocument* dtdDocument)
{
	this->dtdDocument = dtdDocument;
}

DTDDocument* XMLDocument::getDtdDocument()
{
	return this->dtdDocument;
}

bool XMLDocument::checkDocumentValidity()
{
	if (dtdDocument == NULL)
	{
		return true;
	}
	else
	{
		return dtdDocument->checkDocumentValidity(rootNode);
	}
}
